import Vue from 'vue'
import popup from './popup.vue'
import store from '@/store'
import router from '@/router'

const PopupBox = Vue.extend(popup)

popup.install = function(options = {}) {
  let instance = new PopupBox({
    data: options,
    store,
    router
  }).$mount()

  document.body.appendChild(instance.$el)
  Vue.nextTick(() => {
    instance.visible = true
    instance.currentTab = options.currentTab
  })
}

export default popup
